{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lTx8eQlc3cP-"
      },
      "source": [
        "##### Copyright 2025 Google LLC."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "cellView": "form",
        "id": "4HZoi8yf4GEU"
      },
      "outputs": [],
      "source": [
        "# @title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
        "# you may not use this file except in compliance with the License.\n",
        "# You may obtain a copy of the License at\n",
        "#\n",
        "# https://www.apache.org/licenses/LICENSE-2.0\n",
        "#\n",
        "# Unless required by applicable law or agreed to in writing, software\n",
        "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
        "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
        "# See the License for the specific language governing permissions and\n",
        "# limitations under the License."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "M9I7LG483nXB"
      },
      "source": [
        "# Movie Recommendation System with Gemini API and Qdrant"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "awKO767lQIWh"
      },
      "source": [
        "<a target=\"_blank\" href=\"https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/qdrant/Movie_Recommendation.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" height=30/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "bbf4f2c17530"
      },
      "source": [
        "<!-- Princing warning Badge -->\n",
        "<table>\n",
        "  <tr>\n",
        "    <!-- Emoji -->\n",
        "    <td bgcolor=\"#f5949e\">\n",
        "      <font size=30>⚠️</font>\n",
        "    </td>\n",
        "    <!-- Text Content Cell -->\n",
        "    <td bgcolor=\"#f5949e\">\n",
        "      <h3><font color=black>This notebook requires paid tier rate limits to run properly.<br>  \n",
        "(cf. <a href=\"https://ai.google.dev/pricing#veo2\"><font color='#217bfe'>pricing</font></a> for more details).</font></h3>\n",
        "    </td>\n",
        "  </tr>\n",
        "</table>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "b1xoF_bU4NCP"
      },
      "source": [
        "## Overview"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "CWedABji6bXJ"
      },
      "source": [
        "The [Gemini API](https://ai.google.dev/models/gemini) provides access to a family of generative AI models for generating content and solving problems. These models are designed and trained to handle both text and images as input.\n",
        "\n",
        "[Qdrant](https://qdrant.tech/) is an open-source vector similarity search engine designed for efficient and scalable semantic search. It offers a simple yet powerful API to store and search high-dimensional vectors, supports filtering with metadata (payloads), and integrates easily into production systems. Qdrant can be self-hosted or accessed via its managed cloud service, making it quick to set up and ideal for a wide range of AI applications that rely on semantic understanding and retrieval.\n",
        "\n",
        "In this notebook, you'll learn how to perform a similarity search on data from a website with the help of Gemini API and Qdrant.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "a5cc7bb8d6bf"
      },
      "source": [
        "<!-- Community Contributor Badge -->\n",
        "<table>\n",
        "  <tr>\n",
        "    <!-- Author Avatar Cell -->\n",
        "    <td bgcolor=\"#d7e6ff\">\n",
        "      <a href=\"https://github.com/andycandy\" target=\"_blank\" title=\"View Anand Roy's profile on GitHub\">\n",
        "        <img src=\"https://github.com/andycandy.png?size=100\"\n",
        "             alt=\"andycandy's GitHub avatar\"\n",
        "             width=\"100\"\n",
        "             height=\"100\">\n",
        "      </a>\n",
        "    </td>\n",
        "    <!-- Text Content Cell -->\n",
        "    <td bgcolor=\"#d7e6ff\">\n",
        "      <h2><font color='black'>This notebook was contributed by <a href=\"https://github.com/andycandy\" target=\"_blank\"><font color='#217bfe'><strong>Anand Roy</strong></font></a>.</font></h2>\n",
        "      <h5><font color='black'><a href=\"https://www.linkedin.com/in/anand-roy-61a2b529b\"><font color=\"#078efb\">LinkedIn</font></a> - See <a href=\"https://github.com/andycandy\" target=\"_blank\"><font color=\"#078efb\"><strong>Anand</strong></font></a> other notebooks <a href=\"https://github.com/search?q=repo%3Agoogle-gemini%2Fcookbook%20%22Anand%20Roy%22&type=code\" target=\"_blank\"><font color=\"#078efb\">here</font></a>.</h5></font><br>\n",
        "      <!-- Footer -->\n",
        "      <font color='black'><small><em>Have a cool Gemini example? Feel free to <a href=\"https://github.com/google-gemini/cookbook/blob/main/CONTRIBUTING.md\" target=\"_blank\"><font color=\"#078efb\">share it too</font></a>!</em></small></font>\n",
        "    </td>\n",
        "  </tr>\n",
        "</table>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "dIAarGkG8VwC"
      },
      "source": [
        "## Setup\n",
        "\n",
        "First, you must install the packages and set the necessary environment variables.\n",
        "\n",
        "### Installation"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "70wYOKUC8q1m"
      },
      "source": [
        "Install google's python client SDK for the Gemini API, `google-genai`. Next, install Qdrant's Python client SDK, `qdrant-client`."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "mnQbBnA1GKha"
      },
      "outputs": [],
      "source": [
        "%pip install -q \"google-genai>=1.0.0\"\n",
        "%pip install -q protobuf==4.25.1 qdrant-client[fastembed]"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "eomJzCa6lb90"
      },
      "source": [
        "## Configure your API key\n",
        "\n",
        "To run the following cell, your API key must be stored it in a Colab Secret named `GEMINI_API_KEY`. If you don't already have an API key, or you're not sure how to create a Colab Secret, see [Authentication](https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb) for an example."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "v-JZzORUpVR2"
      },
      "outputs": [],
      "source": [
        "from google.colab import userdata\n",
        "from google import genai\n",
        "\n",
        "GEMINI_API_KEY=userdata.get('GEMINI_API_KEY')\n",
        "client = genai.Client(api_key=GEMINI_API_KEY)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "DSI_-yD-f6RA"
      },
      "source": [
        "## Building the Movie Vector Index\n",
        "This section covers preparing the movie dataset, generating embeddings using Gemini, and indexing them in Qdrant for similarity search."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "eXG76XuDoq5H"
      },
      "source": [
        "### 1. Load the Dataset from Kaggle"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Y9a57dXrnIEt"
      },
      "source": [
        "Begin by loading the dataset from Kaggle using the kagglehub library. The dataset used in this notebook is the [TMDB Movie Dataset 2024](https://www.kaggle.com/datasets/asaniczka/tmdb-movies-dataset-2023-930k-movies), which contains approximately 1 Million+ movie entries."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "id": "8n-X5X7cBWVL"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "/tmp/ipykernel_26130/2431045845.py:6: DeprecationWarning: load_dataset is deprecated and will be removed in a future version.\n",
            "  df = kagglehub.load_dataset(\n"
          ]
        }
      ],
      "source": [
        "import kagglehub\n",
        "from kagglehub import KaggleDatasetAdapter\n",
        "\n",
        "file_path = \"TMDB_movie_dataset_v11.csv\"\n",
        "\n",
        "df = kagglehub.load_dataset(\n",
        "  KaggleDatasetAdapter.PANDAS,\n",
        "  \"asaniczka/tmdb-movies-dataset-2023-930k-movies\",\n",
        "  file_path,\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "o5UoP2DknSdw"
      },
      "source": [
        "### 2. Inspect the Dataset Structure"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "zbq3XQOso2ca"
      },
      "source": [
        "Since the dataset is large, inspecting it helps you identify useful fields and filter out irrelevant data early on."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "id": "dLAP-cw9DS3O"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "\n",
            "Dataset Columns:\n",
            "Index(['id', 'title', 'vote_average', 'vote_count', 'status', 'release_date',\n",
            "       'revenue', 'runtime', 'adult', 'backdrop_path', 'budget', 'homepage',\n",
            "       'imdb_id', 'original_language', 'original_title', 'overview',\n",
            "       'popularity', 'poster_path', 'tagline', 'genres',\n",
            "       'production_companies', 'production_countries', 'spoken_languages',\n",
            "       'keywords'],\n",
            "      dtype='object')\n",
            "\n",
            "Missing Values per Column:\n",
            "id                            0\n",
            "title                        13\n",
            "vote_average                  0\n",
            "vote_count                    0\n",
            "status                        0\n",
            "release_date             239109\n",
            "revenue                       0\n",
            "runtime                       0\n",
            "adult                         0\n",
            "backdrop_path            930599\n",
            "budget                        0\n",
            "homepage                1123663\n",
            "imdb_id                  624300\n",
            "original_language             0\n",
            "original_title               13\n",
            "overview                 270635\n",
            "popularity                    0\n",
            "poster_path              418486\n",
            "tagline                 1078824\n",
            "genres                   526517\n",
            "production_companies     702743\n",
            "production_countries     580808\n",
            "spoken_languages         557829\n",
            "keywords                 928832\n",
            "dtype: int64\n",
            "\n",
            "Number of rows: 1254611\n",
            "Number of unique IDs: 1253629\n"
          ]
        }
      ],
      "source": [
        "print(\"\\nDataset Columns:\")\n",
        "print(df.columns)\n",
        "\n",
        "print(\"\\nMissing Values per Column:\")\n",
        "print(df.isnull().sum())\n",
        "\n",
        "print(f\"\\nNumber of rows: {len(df)}\")\n",
        "print(f\"Number of unique IDs: {df['id'].nunique()}\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "-DHqjBnho8sB"
      },
      "source": [
        "### 3. Filter and Clean the Dataset"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "90khrPi0pB1G"
      },
      "source": [
        "This step filters the dataset to keep only metadata useful for semantic search: `id`, `title`, `overview`, `genres`, `keywords`, `tagline`, and `release_date`. These fields provide enough context to generate meaningful embeddings.\n",
        "\n",
        "Entries (rows) missing a `title` or lacking both `overview` and `genres` are removed, as they don’t have enough descriptive data for accurate recommendations.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "metadata": {
        "id": "FvanvDRbRGz2"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Original rows: 1254611\n",
            "Rows before dropping missing title: 1254611\n",
            "Rows after dropping missing title and dropping missing (genres and overview): 1109811\n",
            "\n",
            "Sample data after cleaning (keeping missing overviews):\n",
            "       id            title                                           overview  \\\n",
            "0   27205        Inception  Cobb, a skilled thief who commits corporate es...   \n",
            "1  157336     Interstellar  The adventures of a group of explorers who mak...   \n",
            "2     155  The Dark Knight  Batman raises the stakes in his war on crime. ...   \n",
            "3   19995           Avatar  In the 22nd century, a paraplegic Marine is di...   \n",
            "4   24428     The Avengers  When an unexpected enemy emerges and threatens...   \n",
            "\n",
            "                                        genres  \\\n",
            "0           Action, Science Fiction, Adventure   \n",
            "1            Adventure, Drama, Science Fiction   \n",
            "2               Drama, Action, Crime, Thriller   \n",
            "3  Action, Adventure, Fantasy, Science Fiction   \n",
            "4           Science Fiction, Action, Adventure   \n",
            "\n",
            "                                            keywords  \\\n",
            "0  rescue, mission, dream, airplane, paris, franc...   \n",
            "1  rescue, future, spacecraft, race against time,...   \n",
            "2  joker, sadism, chaos, secret identity, crime f...   \n",
            "3  future, society, culture clash, space travel, ...   \n",
            "4  new york city, superhero, shield, based on com...   \n",
            "\n",
            "                                             tagline  release_year  \n",
            "0               Your mind is the scene of the crime.        2010.0  \n",
            "1  Mankind was born on Earth. It was never meant ...        2014.0  \n",
            "2                  Welcome to a world without rules.        2008.0  \n",
            "3                        Enter the world of Pandora.        2009.0  \n",
            "4                            Some assembly required.        2012.0  \n"
          ]
        }
      ],
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import ast\n",
        "print(f\"Original rows: {len(df)}\")\n",
        "\n",
        "columns_to_keep = ['id', 'title', 'overview', 'genres', 'keywords', 'tagline', 'release_date']\n",
        "\n",
        "df_relevant = df[columns_to_keep].copy()\n",
        "\n",
        "print(f\"Rows before dropping missing title: {len(df_relevant)}\")\n",
        "df_relevant.dropna(subset=['title'], inplace=True)\n",
        "df_relevant = df_relevant[~(df_relevant['genres'].isna() & df_relevant['overview'].isna())]\n",
        "print(f\"Rows after dropping missing title and dropping missing (genres and overview): {len(df_relevant)}\")\n",
        "\n",
        "# Fill missing text columns with empty strings\n",
        "text_cols_to_fill = ['overview', 'genres', 'keywords', 'tagline']\n",
        "for col in text_cols_to_fill:\n",
        "    df_relevant[col] = df_relevant[col].fillna('')\n",
        "\n",
        "\n",
        "# Extract release year from the release_date string\n",
        "def get_year(date_str):\n",
        "    if pd.isna(date_str) or not isinstance(date_str, str) or len(date_str) < 4:\n",
        "        return None\n",
        "    try:\n",
        "        return int(date_str[:4])\n",
        "    except (ValueError, TypeError):\n",
        "        return None\n",
        "\n",
        "df_relevant['release_year'] = df_relevant['release_date'].apply(get_year)\n",
        "\n",
        "print(\"\\nSample data after cleaning (keeping missing overviews):\")\n",
        "print(df_relevant[['id', 'title', 'overview', 'genres', 'keywords', 'tagline', 'release_year']].head())"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lQOfcdqmxLqE"
      },
      "source": [
        "### 4. Prepare Text for Embedding"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Bdcu4I9Lq0Kn"
      },
      "source": [
        "This step prepares the movie metadata for embedding by combining relevant fields into a single structured text string. This representation includes the title, overview, genres, keywords, tagline, and release year (if available). The output is stored in a new column called `text_for_embedding`.\n",
        "\n",
        "Embeddings are numerical vector representations of text that capture semantic meaning and relationships. These vectors can be used for tasks like similarity search and clustering.\n",
        "Learn more about [text embeddings](https://ai.google.dev/gemini-api/docs/embeddings) and explore the [Gemini embedding notebook](../../quickstarts/Embeddings.ipynb)."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "id": "POQgvioiZdYe"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "       id            title                                 text_for_embedding\n",
            "0   27205        Inception  Title: Inception\\nOverview: Cobb, a skilled th...\n",
            "1  157336     Interstellar  Title: Interstellar\\nOverview: The adventures ...\n",
            "2     155  The Dark Knight  Title: The Dark Knight\\nOverview: Batman raise...\n",
            "3   19995           Avatar  Title: Avatar\\nOverview: In the 22nd century, ...\n",
            "4   24428     The Avengers  Title: The Avengers\\nOverview: When an unexpec...\n"
          ]
        }
      ],
      "source": [
        "def create_embedding_text(row):\n",
        "    \"\"\"Combines available movie metadata into a single string for embedding.\"\"\"\n",
        "    # Title is always present, so it can be included directly\n",
        "    title_str = f\"Title: {row['title']}\"\n",
        "    overview_str = f\"Overview: {row['overview']}\" if row['overview'] else \"\"\n",
        "    year_str = f\"Release Year: {int(row['release_year'])}\" if pd.notna(row['release_year']) else \"\"\n",
        "    genre_str = f\"Genres: {row['genres']}\" if row['genres'] else \"\"\n",
        "    keywords_str = f\"Keywords: {row['keywords']}\" if row['keywords'] else \"\"\n",
        "    tagline_str = f\"Tagline: {row['tagline']}\" if row['tagline'] else \"\"\n",
        "\n",
        "    parts = [\n",
        "        title_str,\n",
        "        overview_str,\n",
        "        year_str,\n",
        "        genre_str,\n",
        "        keywords_str,\n",
        "        tagline_str\n",
        "    ]\n",
        "    return \"\\n\".join(part for part in parts if part)\n",
        "\n",
        "df_relevant['text_for_embedding'] = df_relevant.apply(create_embedding_text, axis=1)\n",
        "\n",
        "# Use this to inspect how movie data has been transformed for embedding\n",
        "print(df_relevant[['id', 'title', 'text_for_embedding']].head())"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "e9aASY5Uf_RO"
      },
      "source": [
        "### 5. Sample a Subset for Development"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4G6hxoLDx0vz"
      },
      "source": [
        "To keep the notebook easy to run and ensure efficient development, you’ll want to iterate quickly and minimize resource usage. Instead of using the full dataset, this step samples 5,000 movies from the cleaned data, unless the dataset is already smaller, in which case all entries are used."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "id": "U7xpaVeLZxYc"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "\n",
            "Taking a random sample of 5000 movies for development.\n",
            "Working with 5000 movies for the next steps.\n",
            "            id               title  release_year\n",
            "95090   714945              Gather        2020.0\n",
            "198838  117602    California Girls        1985.0\n",
            "827619  648297          After Jake        2013.0\n",
            "801274  637062  Duas vezes Senzala        2017.0\n",
            "846938  342211                Rise           NaN\n",
            "\n",
            "Final sample DataFrame structure for embedding/indexing:\n",
            "<class 'pandas.core.frame.DataFrame'>\n",
            "Index: 5000 entries, 95090 to 650934\n",
            "Data columns (total 8 columns):\n",
            " #   Column              Non-Null Count  Dtype  \n",
            "---  ------              --------------  -----  \n",
            " 0   id                  5000 non-null   int64  \n",
            " 1   text_for_embedding  5000 non-null   object \n",
            " 2   title               5000 non-null   object \n",
            " 3   overview            5000 non-null   object \n",
            " 4   genres              5000 non-null   object \n",
            " 5   keywords            5000 non-null   object \n",
            " 6   tagline             5000 non-null   object \n",
            " 7   release_year        4260 non-null   float64\n",
            "dtypes: float64(1), int64(1), object(6)\n",
            "memory usage: 351.6+ KB\n",
            "None\n"
          ]
        }
      ],
      "source": [
        "SAMPLE_SIZE = 5000\n",
        "\n",
        "if len(df_relevant) > SAMPLE_SIZE:\n",
        "    print(f\"\\nTaking a random sample of {SAMPLE_SIZE} movies for development.\")\n",
        "    df_sample = df_relevant.sample(n=SAMPLE_SIZE, random_state=42)\n",
        "else:\n",
        "    print(f\"\\nCleaned dataset size ({len(df_relevant)}) is smaller than or equal to SAMPLE_SIZE. Using the full cleaned dataset.\")\n",
        "    df_sample = df_relevant\n",
        "\n",
        "print(f\"Working with {len(df_sample)} movies for the next steps.\")\n",
        "print(df_sample[['id', 'title', 'release_year']].head())\n",
        "\n",
        "columns_for_payload = ['title', 'overview', 'genres', 'keywords', 'tagline', 'release_year']\n",
        "columns_final = ['id', 'text_for_embedding'] + columns_for_payload\n",
        "df_sample = df_sample[columns_final]\n",
        "\n",
        "print(\"\\nFinal sample DataFrame structure for embedding/indexing:\")\n",
        "print(df_sample.info())"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "NNK2HU9CyQ-N"
      },
      "source": [
        "### 6. Initialize Qdrant for Vector Indexing\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "s-cBsGtF3xVK"
      },
      "source": [
        "With the data prepared, the next step is to set up **Qdrant**, a vector similarity search engine optimized for storing and querying high-dimensional vectors. It supports fast indexing, filtering, and similarity search across millions of vectors.\n",
        "\n",
        "Qdrant can run:\n",
        "\n",
        "* Locally as a standalone service\n",
        "* In the cloud for production deployments\n",
        "* Or entirely **in-memory** for fast, temporary use during development\n",
        "\n",
        "In this notebook, Qdrant is initialized using in-memory mode by passing `\":memory:\"` to the client. This stores data only in RAM, meaning it **will not persist after the session ends**. This is suitable for experimentation but not for saving results long-term.\n",
        "\n",
        "You also configure the following:\n",
        "\n",
        "* `COLLECTION_NAME`: The name of the Qdrant collection to store movie vectors\n",
        "* `VECTOR_SIZE`: Set to `3072` to match the dimensionality of the text embeddings generated by Gemini\n",
        "* `DISTANCE_METRIC`: Set to **cosine distance**, which is ideal for measuring semantic similarity between embedding vectors"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "id": "OQqy7lxgajVI"
      },
      "outputs": [],
      "source": [
        "from qdrant_client import QdrantClient, models\n",
        "import time\n",
        "\n",
        "COLLECTION_NAME = \"tmdb_movies_sample\"\n",
        "\n",
        "VECTOR_SIZE = 3072\n",
        "DISTANCE_METRIC = models.Distance.COSINE\n",
        "\n",
        "\n",
        "# Initialize Qdrant client using in-memory storage\n",
        "qdrant_client = QdrantClient(\":memory:\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "If3cSgEHgGlJ"
      },
      "source": [
        "### 7. Define Batch Embedding Function"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "VHkDkoBQ31Ie"
      },
      "source": [
        "This step defines the `get_embeddings_batch` function, which generates text embeddings for batches of movie data using the Gemini embedding model (`gemini-embedding-001`) including automatic retries for robustness.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "qWODHe__bAeO"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Example embedding vector: [-0.023393, 0.011092304, 0.007310852, -0.095236674, 0.012521885, 0.0069673047, -0.011544445, -0.02173588, 0.027118236, 0.004006482]\n"
          ]
        }
      ],
      "source": [
        "import time\n",
        "from google.api_core import exceptions, retry\n",
        "\n",
        "MODEL_FOR_EMBEDDING = \"gemini-embedding-001\" # @param [\"gemini-embedding-001\", \"embedding-001\", \"text-embedding-004\"] {\"allow-input\":true, isTemplate: true}\n",
        "\n",
        "BATCH_SIZE = 25\n",
        "QDRANT_BATCH_SIZE = 3072\n",
        "\n",
        "\n",
        "@retry.Retry(timeout=3000)\n",
        "def get_embeddings_batch(texts: list[str], task_type=\"RETRIEVAL_DOCUMENT\") -> list[list[float]] | None:\n",
        "    \"\"\"\n",
        "    Generates embeddings for a batch of texts using Gemini API with retry.\n",
        "\n",
        "    Args:\n",
        "        texts: A list of strings to embed.\n",
        "        task_type: The task type for the embedding model.\n",
        "\n",
        "    Returns:\n",
        "        A list of embedding vectors (list of floats), or None if a non-retryable error occurs.\n",
        "    \"\"\"\n",
        "    if not texts:\n",
        "        return []\n",
        "    try:\n",
        "        response = client.models.embed_content(\n",
        "          model=MODEL_FOR_EMBEDDING,\n",
        "          contents=texts,\n",
        "          config={\n",
        "            \"task_type\":task_type,\n",
        "          }\n",
        "        )\n",
        "        return response.embeddings\n",
        "    except exceptions.RetryError as e:\n",
        "        print(f\"Embedding batch failed after retries: {e}\")\n",
        "        return None\n",
        "    except Exception as e:\n",
        "        print(f\"An unexpected error occurred during embedding: {e}\")\n",
        "        return None\n",
        "\n",
        "# Example of what an embedding looks like\n",
        "sample_embedding = get_embeddings_batch([\"Example movie about space and survival\"])[0]\n",
        "print(\"Example embedding vector:\", sample_embedding.values[:10])"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "O-LbEZvKghOW"
      },
      "source": [
        "### 8. Create a Collection in Qdrant\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "X9tIp23934sv"
      },
      "source": [
        "A collection in Qdrant is like a table in a database, it stores vectors along with optional metadata (payload). Each collection has its own configuration, including vector size and similarity metric."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "id": "m0TDkDU7bPq5"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Existing collection 'tmdb_movies_sample' deleted.\n",
            "Collection 'tmdb_movies_sample' created successfully.\n"
          ]
        }
      ],
      "source": [
        "# In case someone tries running the whole notebook again they would want to create the collection again\n",
        "\n",
        "try:\n",
        "    qdrant_client.delete_collection(collection_name=COLLECTION_NAME)\n",
        "    print(f\"Existing collection '{COLLECTION_NAME}' deleted.\")\n",
        "except Exception as e:\n",
        "    print(f\"Error deleting collection (it might not exist): {e}\")\n",
        "\n",
        "try:\n",
        "    qdrant_client.create_collection(\n",
        "        collection_name=COLLECTION_NAME,\n",
        "        vectors_config=models.VectorParams(\n",
        "            size=VECTOR_SIZE,\n",
        "            distance=DISTANCE_METRIC\n",
        "        )\n",
        "    )\n",
        "    print(f\"Collection '{COLLECTION_NAME}' created successfully.\")\n",
        "except Exception as e:\n",
        "    print(f\"Error creating collection: {e}\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "-Dp5nla31TJn"
      },
      "source": [
        "### 9. Create Payloads for Metadata Storage\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "lyIG8Ip24KGO"
      },
      "source": [
        "In Qdrant, besides storing vector embeddings, you can attach additional information called payload to each vector. This metadata helps in filtering or retrieving relevant results based on attributes like title, genres, or release year.\n",
        "\n",
        "The `create_payload` function prepares the payload by extracting specified columns from each movie record, handling missing values and ensuring data types are compatible with Qdrant."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "id": "YhcyKADBbXze"
      },
      "outputs": [],
      "source": [
        "payload_columns = [\n",
        "    'title', 'overview', 'genres', 'keywords', 'tagline', 'release_year'\n",
        "]\n",
        "\n",
        "def create_payload(row, payload_columns):\n",
        "    payload = {}\n",
        "    for col in payload_columns:\n",
        "        value = row[col]\n",
        "        if pd.isna(value):\n",
        "            payload[col] = None\n",
        "        elif isinstance(value, (np.int64, np.int32)):\n",
        "            payload[col] = int(value)\n",
        "        elif isinstance(value, (np.float64, np.float32)):\n",
        "             payload[col] = float(value)\n",
        "        else:\n",
        "            payload[col] = value\n",
        "    return payload"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "XRmxfjDj1zmN"
      },
      "source": [
        "### 10. Batch Embedding and Indexing to Qdrant\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "QImVW0tC38fi"
      },
      "source": [
        "This step processes the sampled movies dataset in batches to generate vector embeddings using the Gemini API and upload (upsert) these embeddings along with their metadata payloads to the Qdrant collection.\n",
        "\n",
        "**Key points of this process:**\n",
        "\n",
        "* The dataset is divided into batches of size `BATCH_SIZE` for embedding generation to stay within API limits.\n",
        "* Each batch's text data is sent to the Gemini embedding API with retries handled in the embedding function.\n",
        "* For every successfully embedded batch, the code prepares **points** (each containing an ID, vector embedding, and metadata payload) to be uploaded to Qdrant.\n",
        "* Points are buffered and uploaded in chunks of size `QDRANT_BATCH_SIZE` to optimize performance.\n",
        "* The process includes error handling and retry logic to avoid failures halting the entire operation.\n",
        "* At the end, any remaining points in the buffer are uploaded.\n",
        "* Summary statistics of processed, failed, and successfully upserted items are printed.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "id": "Jp-omB2jbfpS"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Starting batch embedding and indexing process for 5000 movies...\n",
            "Using Gemini Batch Size: 25, Qdrant Upsert Batch Size: 3072\n"
          ]
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "Processing Batches: 100%|██████████| 200/200 [04:15<00:00,  1.28s/it]"
          ]
        },
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Batch embedding and indexing finished.\n",
            "Total items processed (attempted embedding): 5000\n",
            "Total points successfully prepared for upsert: 5000\n"
          ]
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "\n"
          ]
        }
      ],
      "source": [
        "from tqdm import tqdm\n",
        "\n",
        "print(f\"Starting batch embedding and indexing process for {len(df_sample)} movies...\")\n",
        "print(f\"Using Gemini Batch Size: {BATCH_SIZE}, Qdrant Upsert Batch Size: {QDRANT_BATCH_SIZE}\")\n",
        "\n",
        "points_to_upsert_buffer = []\n",
        "total_processed = 0\n",
        "total_failed_embedding = 0\n",
        "total_upserted = 0\n",
        "\n",
        "num_batches = (len(df_sample) + BATCH_SIZE - 1) // BATCH_SIZE\n",
        "\n",
        "for i in tqdm(range(0, len(df_sample), BATCH_SIZE), total=num_batches, desc=\"Processing Batches\"):\n",
        "    batch_df = df_sample.iloc[i : i + BATCH_SIZE]\n",
        "    batch_texts = batch_df['text_for_embedding'].tolist()\n",
        "    batch_ids = batch_df['id'].tolist()\n",
        "\n",
        "    if not batch_texts:\n",
        "        continue\n",
        "\n",
        "    # Generate embeddings for the current batch of movie texts\n",
        "    batch_embeddings = get_embeddings_batch(batch_texts, task_type=\"RETRIEVAL_DOCUMENT\")\n",
        "\n",
        "    # Check if embeddings were successfully generated and correspond to batch size\n",
        "    if batch_embeddings and len(batch_embeddings) == len(batch_texts):\n",
        "        for j in range(len(batch_ids)):\n",
        "            item_id = batch_ids[j]\n",
        "            item_embedding = batch_embeddings[j]\n",
        "            row_data = batch_df.iloc[j]\n",
        "\n",
        "            # Prepare metadata payload for this movie\n",
        "            payload = create_payload(row_data, payload_columns)\n",
        "\n",
        "            # Create a Qdrant PointStruct with id, embedding vector, and payload\n",
        "            point = models.PointStruct(\n",
        "                id=int(item_id),\n",
        "                vector=item_embedding.values,\n",
        "                payload=payload\n",
        "            )\n",
        "            points_to_upsert_buffer.append(point)\n",
        "\n",
        "        total_processed += len(batch_ids)\n",
        "\n",
        "    else:\n",
        "        print(f\"Failed to get embeddings for batch starting at index {i}. Skipping {len(batch_ids)} items.\")\n",
        "        total_failed_embedding += len(batch_ids)\n",
        "        continue\n",
        "\n",
        "    # Upload buffered points to Qdrant if buffer reached batch size or end of data\n",
        "    if len(points_to_upsert_buffer) >= QDRANT_BATCH_SIZE or (i + BATCH_SIZE >= len(df_sample)):\n",
        "        if points_to_upsert_buffer:\n",
        "            try:\n",
        "                qdrant_client.upsert(\n",
        "                    collection_name=COLLECTION_NAME,\n",
        "                    points=points_to_upsert_buffer,\n",
        "                    wait=False\n",
        "                )\n",
        "                total_upserted += len(points_to_upsert_buffer)\n",
        "                points_to_upsert_buffer = []\n",
        "            except Exception as e:\n",
        "                print(f\"Error upserting chunk to Qdrant: {e}\")\n",
        "                points_to_upsert_buffer = []\n",
        "                time.sleep(5)\n",
        "                # Pause before retrying to avoid hammering the service after an error\n",
        "\n",
        "# Upload any remaining points left in buffer after loop completion\n",
        "if points_to_upsert_buffer:\n",
        "    print(f\"Upserting final remaining chunk of {len(points_to_upsert_buffer)} points.\")\n",
        "    try:\n",
        "        qdrant_client.upsert(\n",
        "            collection_name=COLLECTION_NAME,\n",
        "            points=points_to_upsert_buffer,\n",
        "            wait=True\n",
        "        )\n",
        "        total_upserted += len(points_to_upsert_buffer)\n",
        "        points_to_upsert_buffer = []\n",
        "    except Exception as e:\n",
        "        print(f\"Error upserting final chunk: {e}\")\n",
        "\n",
        "print(\"Batch embedding and indexing finished.\")\n",
        "print(f\"Total items processed (attempted embedding): {total_processed}\")\n",
        "print(f\"Total points successfully prepared for upsert: {total_upserted}\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "id": "v6l-OtOFsmeW"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "\n",
            "Verification: Collection 'tmdb_movies_sample' now contains 5000 points.\n"
          ]
        }
      ],
      "source": [
        "# Waiting for collection to settle\n",
        "time.sleep(5)\n",
        "\n",
        "try:\n",
        "    count = qdrant_client.count(collection_name=COLLECTION_NAME, exact=True)\n",
        "    print(f\"\\nVerification: Collection '{COLLECTION_NAME}' now contains {count.count} points.\") # it should print 5000\n",
        "\n",
        "except Exception as e:\n",
        "    print(f\"Error verifying collection count: {e}\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "jtFYhuo52rGi"
      },
      "source": [
        "### 11. Search and Recommend Similar Movies Using Vector Embeddings\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "bjNKMgn54GSG"
      },
      "source": [
        "With all movie vectors indexed in Qdrant, you can now perform semantic search. This allows you to take any user query (such as a phrase, movie description, or concept), convert it into an embedding using the same Gemini model, and retrieve the most similar movie vectors from the collection using cosine similarity.\n",
        "\n",
        "This `recommend_movies` function demonstrates how to:\n",
        "\n",
        "* Generate an embedding from your input query using the Gemini API.\n",
        "* Perform a similarity search using Qdrant’s `search()` method.\n",
        "* Retrieve the top `k` most similar movie entries, including their metadata and similarity scores.\n",
        "\n",
        "This is the final step where the vector database functions as a recommendation engine.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 28,
      "metadata": {
        "id": "i3gAZ30qtGZo"
      },
      "outputs": [],
      "source": [
        "def recommend_movies(query_text, top_k=5):\n",
        "    \"\"\"\n",
        "    Finds movies similar to the query_text using the Qdrant index.\n",
        "\n",
        "    Args:\n",
        "        query_text (str): The user's query (e.g., movie title, description, theme).\n",
        "        top_k (int): The maximum number of recommendations to return.\n",
        "\n",
        "    Returns:\n",
        "        list: A list of dictionaries, where each dictionary contains the\n",
        "              payload (movie details) and similarity score of a recommended movie.\n",
        "              Returns an empty list if query embedding fails or no results found.\n",
        "    \"\"\"\n",
        "    print(f\"Searching for recommendations based on: '{query_text}'\")\n",
        "    # Generate embedding for the user query using Gemini\n",
        "    query_embedding = get_embeddings_batch(query_text, task_type=\"RETRIEVAL_QUERY\")[0].values\n",
        "\n",
        "    print(f\"Query embedding: {query_embedding}\")\n",
        "\n",
        "    if query_embedding is None:\n",
        "        print(\"Error: Could not generate embedding for the query.\")\n",
        "        return []\n",
        "\n",
        "    try:\n",
        "        # Perform a semantic search on Qdrant using the query vector\n",
        "        search_result = qdrant_client.search(\n",
        "            collection_name=COLLECTION_NAME,\n",
        "            query_vector=query_embedding,\n",
        "            limit=top_k,\n",
        "            with_payload=True\n",
        "        )\n",
        "\n",
        "        recommendations = []\n",
        "        if search_result:\n",
        "            print(f\"Found {len(search_result)} potential recommendations:\")\n",
        "            for hit in search_result:\n",
        "                recommendation = {\n",
        "                    \"id\": hit.id,\n",
        "                    \"score\": hit.score,\n",
        "                    \"payload\": hit.payload\n",
        "                }\n",
        "                recommendations.append(recommendation)\n",
        "        else:\n",
        "            print(\"No recommendations found matching the query.\")\n",
        "\n",
        "        return recommendations\n",
        "\n",
        "    except Exception as e:\n",
        "        print(f\"Error during Qdrant search: {e}\")\n",
        "        return []"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "kN6jiYMB3OWG"
      },
      "source": [
        "## Try Out Your Movie Recommender\n",
        "You can now try querying your movie recommender by describing a theme, genre, or concept in natural language. The system will return the most semantically similar movies from your dataset based on vector similarity search using Gemini-generated embeddings."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 29,
      "metadata": {
        "id": "T3aRrQZltXM5"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Searching for recommendations based on: '\n",
            "  I want to watch something with my girlfriends that’s\n",
            "  both funny and teaches something.\n",
            "'\n",
            "Query embedding: [-0.007658997, -0.00046528463, 0.003591214, -0.060340602, 0.005171188, -0.031223807, -0.012421608, -0.0029493966, 0.015560944, 0.011762511, 0.0043392465, -0.012576682, -0.00040339225, 0.00087798183, 0.104019016, 0.003676365, -0.004047451, -0.02373786, 0.03213893, -0.008110603, -0.010839047, -0.013205221, 0.005924564, 0.0144873345, 0.028277583, -0.0042119334, 0.030671213, 0.007607076, 0.039369747, -0.005576319, 0.029120907, 0.038622007, 0.022760479, 0.03496449, 0.020038292, 0.020724915, 0.008881883, 0.0064935135, -0.015201997, -0.008609423, -0.0074098404, -0.012157845, -0.0015358008, -0.008790521, 0.010938966, 0.015006626, 0.0006905204, -0.015275856, 0.0053447806, 0.02772103, -0.004355093, -0.022345519, 0.0011232442, -0.15648542, -0.012109607, -0.011598385, -0.036081407, -0.037203718, -0.00052338815, -0.024585776, 0.0056603705, 0.012978436, -0.02326816, -0.042064063, -0.0045854757, -0.0038374194, 0.011914898, -0.008569233, -0.00563646, -0.0057406654, 0.003564379, -0.0027617854, -0.053308308, 0.015196148, 0.024755571, -0.0012330861, -0.0017028818, -0.00686818, 0.026154077, 0.027949875, 0.010232497, 0.013906707, -0.014215794, -0.00077658653, -0.03721396, 0.0038600422, -0.009375854, 0.0014674509, -0.024641044, 0.014696107, 0.011201146, 0.005817903, 0.009098573, 0.025025342, 0.001822161, -0.016922103, -0.017847916, -0.01776402, -0.020937024, 0.0070619164, -0.0019094929, -0.011268232, 0.011396772, -0.00031001618, 0.013096436, -0.036100443, 0.022771003, -0.020070584, 0.002808597, 0.022003504, -0.020196551, -0.000636638, -0.021315569, 0.008470259, 0.009000547, -0.17078017, -0.008122156, -0.033109933, -0.033418566, 0.025020653, 0.025066907, -0.00068508927, 0.013421411, -0.0046520378, -0.0018675564, -0.026637224, 0.0016807325, 0.0023628597, -0.012904365, 0.013818259, 0.0044365413, 0.006451984, 0.019827154, 0.009803692, -0.00086508243, 0.005361341, 0.025869422, -0.022989567, -0.035207458, 0.00782946, -0.00868237, 0.004783333, 0.005028272, 0.024064386, -0.0030946343, -0.017029624, -0.028759211, 0.02417663, -0.0079752, -0.016356735, 0.0061651436, 0.020515447, 0.009211107, 0.010411367, 0.025470657, -0.04449482, -0.031313714, -0.008920078, -0.00679817, 0.008555871, -0.009875798, 0.01754391, 0.021959884, 0.03281524, 0.0326368, 0.0021419073, -0.04363063, -0.012033348, -0.010159976, 0.008532187, -0.010688875, 0.0077637048, -0.023004718, 0.0186693, -0.008716494, -0.018206827, 0.014381067, 0.0048174644, -0.019966824, -0.00861907, -0.016488982, -0.024439292, -0.010636176, -0.008473983, 0.007603981, -0.0034735212, -0.02638222, -0.02585726, -0.021062585, -0.027130863, -0.015517001, -0.011427255, -0.015218365, -0.028255204, -0.01650875, -0.013723117, -0.028768916, 0.010185366, 0.0074167554, -0.006806622, 0.0063054864, 0.023237647, -0.0016865035, -0.016455656, 0.031744212, -0.01627361, 0.019574087, 0.008197609, -0.0006409317, 0.00019125885, 0.011850377, 0.008219198, 0.001074564, 0.006285222, 0.017070089, 0.00430115, -0.007826601, -0.018098341, -0.019536436, -0.0076804105, 0.0002177903, 0.009948032, -0.009858105, 0.003841699, -0.03244334, -0.0061514582, 0.0089194, -0.0054116184, 0.027155975, -0.009489758, 0.012015217, 0.021926388, -0.025226904, -0.005999103, 0.003192276, 0.03090138, -0.0010152623, -0.01733719, 0.0077930144, -0.01608881, 0.0055674957, -0.034486227, -0.0043820743, 0.02704199, 0.012396417, 0.020608665, -0.009348351, -0.0113340095, 0.021533197, -0.036044084, 0.009089745, 0.025076099, 0.0149131585, -0.0012231952, -0.007280102, -0.028033193, -0.024151849, 0.0023524258, -0.015765643, 0.012041331, 0.00069319183, 0.018591883, 0.0002542047, -0.037498366, 0.026034035, 0.0067680064, -0.0061755553, -0.021209368, -0.006945952, -0.008908558, -0.011027979, -0.010595322, -0.017924149, -0.010559117, 0.006408989, -0.021518577, -0.090986796, 0.039785516, 0.0002929304, -0.02052889, -0.0025246276, 0.0006588375, 0.0014102812, -0.00057180604, -0.012298812, 0.029116644, 0.0015695109, -0.040744245, 0.026073812, 0.01575584, 0.008861926, -0.002940912, -0.009908002, -0.0017954942, 0.011384645, 0.022793315, -0.005476442, 0.005729007, -0.02847251, 0.00933073, 0.015413395, -0.023149066, 0.008324465, 0.025822783, 0.015564511, -0.028879244, 0.0050899605, 0.0037440495, 0.005894369, 0.007000974, 0.029747754, -0.005845041, -0.024480214, -0.009036045, 0.009389596, -0.010318457, 0.0007259137, -0.016583202, -0.003526036, 0.0055113044, -0.043244254, 0.002605596, -0.013396861, -0.0030571108, 0.0074796374, 0.010442785, 0.0120480275, -0.0032144173, 0.027740505, -0.018086843, -0.02655576, -0.011034271, 0.010793156, -0.017621357, -0.006851481, 0.0028079296, 0.0057768305, 0.028608013, 0.0011832869, -0.0046113348, 0.005604672, -0.011559473, -0.020079494, -0.0039680647, -0.0039688083, 0.0045066713, -0.013033285, 0.0010227332, 0.0077536954, -0.017619038, 0.0066244686, 0.016033422, 0.014645915, -0.031188952, -0.027699951, 0.020799136, -0.0029071819, 0.002575108, 0.0023917665, 0.0054888125, -0.002581789, -0.0028972367, 0.012691066, -0.004619539, -0.015606726, -0.03397126, -0.0017714342, -0.0044534816, 0.007835043, 0.012658947, 0.025162695, -0.012640416, -0.021605136, 0.014086611, -0.017101815, 0.010080972, 0.0016208524, 0.012214288, -0.017564036, 0.015451822, 0.0039470396, -0.004773936, -0.002797696, -0.013246228, 0.00017820115, -0.001104458, -0.010571956, 0.025198022, 0.033156134, 0.0017193387, -0.00029802072, 0.025473649, 0.015636424, 0.00064610504, -0.011423704, 0.016073214, 0.026640719, -0.008820277, 0.0015606133, 0.02893173, -0.025572315, -0.00030471364, 0.030782057, 0.020380825, -0.031000767, 0.0057919775, -0.0044115954, 0.019928137, -0.024463853, -0.021666268, -0.015180934, -0.020925835, -0.0002376917, 0.014318099, 0.019801548, 0.015912673, 0.002271807, -0.0025969953, -0.011604327, 0.008998591, 0.017520716, 0.012406347, -0.016737945, 0.0083726635, 0.007968838, -0.016135382, 0.0072884276, -0.010487908, -0.0035753946, 0.0107240155, -0.011726428, -0.015216332, -0.030277373, 0.0013562371, -0.028019493, -0.022245107, 0.026155164, 0.0050504827, -0.0030895153, -0.016027715, 0.0055893967, 0.0025199568, 0.00021746533, 0.003640855, 0.021513678, 0.0039686332, 0.012926265, 0.028803183, -0.034903612, 0.0031752947, -0.013128731, 0.03718875, -0.0003471732, 0.0023347682, -0.0027525737, 0.007454023, -0.005649391, 0.021504557, 0.0005076187, 0.00057734444, 0.036704477, 0.020972816, 0.013741402, -0.011241215, -0.014638068, -0.012452405, -0.010014111, -0.0069456035, -0.0024688623, 0.012324837, 0.00035238056, -0.006131865, -0.046360534, 0.00547954, -0.007821357, 0.0035385457, -0.0065890914, -0.0074244733, 0.016856935, 0.030092394, 0.0025790888, -0.0020089166, 0.030517366, -0.012043013, 0.009543671, -0.00089274277, -0.0025749835, -0.021205744, -0.014578421, -0.009861802, 0.0027759848, -0.00043118862, -0.028540818, 0.017269079, 0.0058239023, -0.0065161805, 0.0022153195, -0.0061800205, -0.014135457, 0.013428522, 0.021900242, 0.015292033, 0.0003717151, -0.016042173, -0.0027988374, 0.011540375, -0.0054776827, 0.0029937162, 0.014818503, 0.012412274, 0.025184965, 0.014466907, 0.0015671736, 0.005630999, 0.0029309771, 0.014803043, -0.008866575, -0.018555135, 0.019640764, -0.016094504, -0.003247497, 0.015909618, -0.018252822, 0.025916709, 0.015193605, -0.004668896, 0.012187923, 0.007975462, 0.007445126, 0.0051937522, 0.015618921, 0.008710195, -0.0027026827, 0.009976356, 0.027163284, 0.011713717, 0.018000696, 0.017720785, 0.011064213, -0.0044663902, 0.023849942, -0.00054423977, 0.00043771532, -0.023048224, 0.0019746043, -0.13866638, 0.021222286, 0.014122536, -0.022164857, -0.013143647, -0.0020018294, -0.0045626294, -0.030105548, -0.018415859, 0.012108164, 0.013794426, 0.011044446, 0.013114799, 0.0027841032, -0.019677445, -0.015389232, -0.04142834, 0.0073212516, -0.00538476, 0.0030036941, -0.012363089, 0.000119079115, 0.0170593, 0.020202946, -0.03161629, -0.014421499, 0.018878808, -0.01269851, -0.0052218647, 0.021183299, -0.02107419, -0.025617171, 0.023082783, 0.0067236633, -0.0147861205, 0.009825783, 0.01084396, -0.015798751, -0.014813038, -0.0050484026, -0.0055987863, 0.024982043, 0.01684569, -0.03080322, -0.02225304, 0.008771082, 0.039080273, -0.027908685, -0.009999861, 0.003912418, -0.019464785, -0.0044295443, -0.002645189, 0.0016026865, -0.0140978275, -0.025296493, -0.0035145467, 0.025298752, 0.0010130565, -0.010643379, -0.0106257675, -0.0009020822, -0.013409499, 0.011197145, -0.018962212, -0.00040592355, -0.0030230957, 0.016632611, 0.014916778, -0.0024387748, -0.00085299416, 0.017969554, 0.0037663796, 0.01937034, -0.0038702097, 0.00028857708, -0.011240717, 0.023880908, -0.005573409, 0.0012341746, 0.0076820278, 0.01324619, -0.06715524, -0.0009302251, -0.012384548, -0.008028726, -0.010517052, -0.019837387, 0.016216794, -0.014291893, -0.00054458313, -0.013849598, -0.020639818, 0.028197555, 0.021053288, -0.021592917, -0.00017535007, -0.024157358, 0.00010338169, 0.013327071, 0.031536996, 0.006767876, 0.010343432, 0.002749156, 0.031576294, -0.008417761, -0.009278888, 0.011850425, -0.014353623, 0.0015116708, -0.016114676, 0.0016085815, -0.010465995, -0.1533119, -0.024002122, -0.009350967, 0.01765787, 0.020268215, 0.008878559, 0.003935286, 0.018290855, -0.013349976, 0.012814336, -0.007508441, -0.007659181, -0.05425788, -0.0069866176, 0.019898038, 0.10711197, 0.008753677, -0.018944684, -0.020007266, -0.017340872, 0.0017044973, -0.033201575, 0.00028279127, -0.016268859, 0.022702044, -0.00069014815, -0.00293471, -0.014179699, -0.03481144, 0.00082100474, -0.0036490634, -0.00020232586, -0.015123449, -0.021791575, 0.034588646, -0.031094, -0.028725695, -0.009999108, 0.011660778, -0.004403104, 0.022052962, 0.006712152, -0.021735676, 0.0117179025, -0.01652556, 0.008919845, -0.03020403, 0.024762977, -0.008622904, -0.004106013, 0.020713564, -0.071457505, -0.0031196587, 0.017729033, -0.0047114836, 0.0040917606, 0.015634848, -0.014170193, 0.026187854, 0.0107954275, -0.0073426473, 0.021145487, -0.016015437, 0.024497885, -0.01595643, 0.000763657, 0.0020547905, 0.004095561, -0.0033628005, 0.029250493, -0.010530722, 0.0071582086, 0.018879306, -0.0019727375, -0.00424072, -0.0025716396, -0.008611844, -0.0055923057, -0.033299115, -0.01950837, -0.01016062, 0.016755832, 0.004772076, -0.0020543523, 0.011220286, -0.0201544, -0.00687639, 0.015268646, -0.009816733, -0.011807438, -0.004061319, -0.00041292066, -0.00042401304, 0.011180533, 0.010682756, -0.015715491, 0.012643108, 0.01729298, -0.012561425, 0.016548326, 0.024526056, 0.0028471788, 0.0075985356, -0.015203041, -0.007274756, -0.021699686, 0.01569737, -0.019667087, 0.009909893, 0.001457101, -0.0072044674, -0.019912073, -0.012935204, -0.011696044, 5.7421137e-05, 0.0045702187, 0.014994755, -0.016617196, -0.011998908, -0.013200046, 0.0042788284, 0.02025074, -0.018209616, 0.0062040472, 0.005529343, -0.0061386796, -0.0083729895, -0.012026071, 0.0013638241, -0.011505059, 0.0126417745, -0.008859362, 0.0089564305, -0.0086596925, 0.0040731537, -0.017586367, -0.008981887, 0.0064300364, -0.0036000477, -0.006679919, 0.025772134, -0.0029664806, -0.012152404, -0.007033255, 0.014094298, 0.007903801, -0.010293337, -0.0019888943, -0.015292717, -0.002041868, 0.011797235, -0.004519074, 0.010078686, 0.005420004, 0.009284654, -0.0055332454, 0.0008315366, 0.009239985, -0.015964592, -0.007698021, -0.0031759494, 0.008842555, -0.017692316, 0.0063306675, 0.018638855, 0.0020397191, 0.04154738, -0.002312984, -0.012956336, 0.0018869438, 0.016916169, 0.014315608, -0.015394208, -0.0020151355, -0.01355505, -0.00057476986, 0.011277512, 0.009440206, -0.0143618, 0.005810886, -0.0052819797, -0.014357108, 0.0078866305, 0.0045338715, 0.0009513074, 0.012422458, 0.0047463486, 0.0075394777, -0.0032987352, 0.009233454, -0.0054475185, -0.027757538, -0.0013756241, -0.0031653573, 0.014214808, 0.008722821, -0.008680919, -0.010043891, -0.017643314, 0.013127313, 0.002003783, 0.007482706, 0.0046775993, 0.009666608, -0.010719407, 0.015360982, 0.028315183, 0.017579371, -0.0011529826, -0.00477332, -0.014053615, 0.0018417593, 0.022229219, -6.109716e-05, -0.0012140211, 0.01809321, 0.018685304, 0.0089851655, -0.007654018, 0.013968587, 0.0022146646, -0.0009316886, -0.007174506, 0.0055577056, -0.003889499, -0.009170802, 0.0067980913, 0.004233373, 0.005220355, -0.0077017336, -0.005039169, 0.004856911, 0.021084948, 0.015002257, 0.0147295315, 0.00015428696, -0.014237486, 0.0027020003, 0.005944119, 0.016102578, -0.008909168, 0.0013300289, 0.0069823354, -0.014557396, -0.009781658, -0.016698163, 0.0086489, -0.005480832, 0.0053271106, 0.006696576, 0.014292303, 0.0071661123, 0.019328628, 0.015828244, 0.0035306031, 0.0016325354, 0.0013450261, 0.015944906, -0.003298467, -0.02013662, -0.0032751919, -0.010804703, 0.0027353407, 0.0022516386, 0.010953056, -0.0107400315, -0.0117435865, 0.004002969, -0.0023432574, 0.008547856, 0.015555689, -0.012074573, 0.0055272933, 0.019067373, -0.011484366, -0.014580571, -0.017525014, 0.0007681359, 0.0018770521, -0.0091883475, -0.0053181774, -0.0011817754, 0.011098707, -0.0008969144, 0.011569207, 0.01993233, 0.01678009, -0.0027669517, 0.01091728, -0.024452277, 0.023284212, 0.012483825, -0.0056518028, -0.0010190306, 0.015998475, -0.0020725904, -0.004331193, -0.0006521756, -0.012775877, -0.0060057607, -0.012332845, 0.0028397166, 0.00041945715, -0.014165126, 0.009723634, 0.008138286, 0.0042393967, 0.033056952, 0.013171098, -0.0016529933, 0.08690597, 0.022119291, 0.013888652, 0.0039681136, -0.0023007942, 0.011059979, 0.0068811937, -0.005849368, 0.010002037, -0.012092394, 0.007285755, -0.0066284263, -0.00017684654, 0.018294754, 0.008878117, -0.0003171162, -0.012044572, -0.008777096, 0.0018811536, -0.0073740683, 0.005527619, -0.0014341285, -0.011666348, -0.015118739, 0.0042227665, -0.007701874, -0.003527962, 0.0075380797, -0.0038195055, 0.0185293, -0.00014567371, -0.011125316, -0.010582311, 0.00413996, -0.008179616, 0.0005166048, -0.0054113767, -0.0026083563, -0.014283568, 0.015240237, 0.0051954496, 0.0064688413, 0.0038129578, -0.007139753, 0.004575633, 0.0073587033, -0.0099075865, 0.007982593, -0.01696727, -0.0055597858, -0.010860797, 0.0054383087, 0.0047574346, 0.015928954, -0.016341196, -0.0044570775, -0.012627082, 0.0059981234, 0.012424853, -0.0064162076, 0.0013672528, 0.014218624, -0.00032350465, 0.02067012, -0.00046651758, -0.005173708, -0.0007645836, -0.0037672103, -0.0126694795, 0.011424892, -0.016417898, -0.010422852, -0.0033403023, 0.002187795, 0.034428418, -0.005146927, -0.009451042, 0.00904989, -0.012985652, -0.0014903257, -0.020605342, 0.007524264, -0.004373296, 0.00588638, 0.0028553181, 0.013919987, -0.00069922215, -0.013450982, -0.00060077885, -0.00037388716, 0.023977341, -0.010110844, -0.005421292, -0.0038639614, 0.018174808, 0.0029796828, 0.08789293, 0.017997812, -0.001989295, 0.009416267, -0.014003008, -0.0016572209, -0.017593447, 0.010291818, 0.018932063, -0.015594497, -0.0086149005, -0.0027811166, -0.010558735, -0.014955367, -0.005828571, -0.0062037446, 0.014839277, -0.00994328, 0.0030717342, 0.013330731, 0.0034295279, 0.001356354, 0.003055507, 0.0150289275, -4.0001178e-06, -0.0035320714, -0.0020917864, 0.004557785, 0.002480882, 0.002452342, -0.005235783, 0.0076960693, -0.0075172544, 0.009323238, 0.0054681017, -0.014203603, -0.015474479, -0.014072328, -0.012549838, 0.004426839, 0.0033509114, -0.015026287, 0.0055971043, 0.00457117, -0.018839393, -0.01237403, -0.011747127, 0.0041541522, -0.008447942, 0.018200528, 0.008084799, 0.004191131, 0.010359905, -0.0045459247, -0.035581768, -0.018639252, -0.024302496, -0.013108518, 0.00885079, 0.0035649054, 0.0038121042, 0.008035062, -0.010100045, 0.01613678, 0.003391214, 0.0027776696, -0.001114339, -0.00039661917, -0.006681058, 0.0022953453, 0.0006767015, 0.024035767, 0.0030061144, 0.01891038, -0.0025292218, 0.024637071, 0.010190557, 0.012729602, -0.01068263, 0.015617061, -0.011138489, -0.021582494, -0.010191133, 0.010515526, -0.005770788, 0.006104209, 0.0020789844, 0.007193557, -0.03244571, -0.0013884498, -0.0013819152, -0.008577763, 0.006604229, -0.0038516524, -0.0011668011, 0.0034447347, 0.018254574, 0.0051441393, 0.0037228994, 0.0050657666, 0.008604439, -0.008334464, 0.016692095, 0.009691496, 0.005161133, -0.023099374, 0.0121204285, 0.0039198934, -0.009351417, -0.016553933, 0.005181388, 0.013293919, -0.0035920897, -0.00021304915, -0.01401034, -0.0018863387, 0.014374793, 0.0067154285, -0.01563392, 0.0047891913, 0.009725314, -0.01172445, -0.0038564233, 0.002604447, 0.0073934435, -0.008110317, 0.008077617, -0.003310526, -0.012857263, 0.004579083, 0.009767188, -0.027437367, -0.0008025597, -0.009844027, -0.019313283, 0.0055579394, -0.0052655055, 0.013871529, -0.022431687, -0.0016426418, -0.008525042, -0.00039536488, -0.011716279, -0.0037092725, 0.004566523, 0.004473933, 0.0038463792, -0.006982295, -0.008002423, 0.009513754, 0.002881404, 0.0006248097, -0.012939346, 0.006009459, -0.00377537, -0.0013895194, -0.009492872, 0.017120417, -0.0015152271, 0.005916176, -0.0059491307, -0.067234986, 0.012253766, 0.0074444935, 0.016165731, 0.001344072, -0.010488827, -0.017757293, 0.005512583, 0.0026479568, -0.008292655, -0.010838857, -0.0006770083, 0.013124725, -0.012566047, -0.00646, -0.0046578725, -0.0026814372, 0.011797752, 0.009798727, -0.0038378015, -0.014882523, -0.013047124, -0.0115188705, 0.014871232, -0.0043439786, 0.006029483, 0.005182279, 0.010170936, 0.007130719, 0.0051691425, -0.01012411, -0.008661977, -0.016223725, 0.0017886042, -0.0028162415, 0.010379227, -0.011040648, -0.008263987, 0.005486166, 0.0026960042, 0.01028885, -0.0022990766, -0.019266395, -0.007148617, -0.010405747, 0.012099641, -0.0026567418, -0.024184292, -0.0057755564, 0.0064665847, -0.0024675769, -0.0068188054, -0.013499302, 0.0039150915, 0.014797415, 0.015224594, -0.010738135, -0.0014854799, -0.009544882, 0.010321002, 0.0008605587, 0.01699674, -0.010921953, -0.0034622103, -0.0015095124, -0.002714625, 0.008251349, 0.0049000676, -0.013062044, 0.0050541647, 0.0025091853, -0.00016750266, 0.012116139, -0.002575998, -0.012124687, -0.009291445, 0.016284306, -0.0076310686, -0.011608585, 0.0077161556, -0.015469137, 0.0048020743, -0.0068413783, -0.013146974, -0.01135707, 0.0013702324, -0.003091048, -0.0052558184, -0.0057980483, 0.014296991, 0.0017028666, 0.010183678, -0.013478601, -0.016485456, -0.0026896833, 0.00905003, -0.00481727, 0.0035155048, 0.00922096, 0.009232772, 0.00012710458, -0.013542093, 0.0022190113, 0.0047122254, 0.001878199, 0.001007107, 0.013600728, 0.0060750255, -0.008205286, 0.008157837, -0.01616658, 0.007591376, -0.0035902308, 0.0021873876, 0.013025769, -6.4269174e-05, -0.01236405, -0.0042607374, -0.00027840378, 0.0051907906, -0.0055216984, 0.003223122, -0.0009837686, 0.00561209, -0.0003724547, -0.0019202601, 0.00022049001, 0.0057346513, 0.009276754, -0.004875279, 0.008637847, -0.0052936114, 0.0032639236, -0.0022198483, -0.016026465, 0.017685112, 0.01968166, 0.001472705, -0.0069903266, -0.005428904, 0.0060011004, -0.012269837, 0.011594421, -0.021439817, 0.0084041795, 0.026304273, -0.014490719, 0.008439753, -0.01945821, 0.010670142, 0.00449942, 0.0014943705, -0.0024544576, 0.027851129, 0.015639672, 0.0042321547, -0.008968311, -0.00371759, -0.017596764, 0.00017685116, 0.02253062, -0.00069718994, 0.0016921401, -0.008936339, 0.0053685466, 0.0001554853, -0.007549965, -0.016603628, -0.0019659833, 0.00020774343, -0.00070434134, -0.00070578867, -0.0025479523, 0.01933265, -0.00086212094, -0.0033013963, 0.0032407648, 0.0015793841, 0.016805397, 0.00011867429, -0.010211817, 0.014287852, 0.0040312726, 0.0019084461, 0.00389028, -0.006524879, 0.022178384, -0.0027210002, 0.006709563, 0.0076527228, 0.0073581645, -0.0032902232, 0.0034367098, 0.0016609242, 0.026220985, 0.011198781, 0.018843776, 0.009396532, 0.008040675, -0.012204076, -0.009837639, 0.002997089, 0.022407558, 0.0059548854, -0.005106112, -0.081501335, -0.008760049, -0.0024354074, -0.0045488398, -0.008838929, 0.012328102, 0.0010132117, 0.0052136644, -0.014495463, 0.00851899, -0.013373341, -0.0028986381, 0.024872597, -0.023162106, 0.012835472, -0.007017604, 0.012248555, -0.01665023, -0.0016751479, 0.008096153, -0.0068524247, 0.0031723862, -0.009787213, 0.0042026145, -0.018576665, 0.01535117, -0.008737915, -0.010481424, 0.011727908, -0.005137712, -0.011983089, 0.0063217646, 0.0051794318, 0.004048605, 0.009628393, -0.020676218, 0.006694707, -0.003512318, -0.13880867, -0.0019480324, -0.0039749597, -0.018086825, -0.023300512, -0.015531483, -0.015373328, 0.022514641, -0.009494201, 0.012720176, -0.0039769947, -0.006976753, 0.018154955, -9.466118e-05, 0.00059898855, -0.00542819, 0.007346858, 0.0051963325, -0.0020456822, -0.017519265, -0.0049052658, -0.0062039257, -0.009924543, 0.014396695, -0.0017948772, 0.0039560297, -0.011914105, 0.003044962, -0.0037690322, -0.0077647613, 0.009051869, -8.1480954e-05, -0.0063030366, -0.0024058272, 0.013117608, -0.009638313, 0.0148048885, -0.0022217778, 0.0023929076, -0.027584517, 0.016172618, 0.0036284178, 0.0052872878, 0.007943195, -0.014504805, 0.013975754, 0.010382476, 0.005292066, 0.00023452978, 0.0015599357, -0.018855603, -0.009583991, 0.009438121, -0.0015038329, 0.011770616, 0.009084031, -0.0026493673, 0.004856194, 0.0016199187, 0.012309684, -0.016463377, 0.0021320123, 0.013354309, -0.015934108, 0.008735338, -0.002153118, 0.017381344, 0.0060658576, 0.015583327, 0.017706338, 0.004251861, -0.013740567, -0.01775026, -0.029767133, 0.0021325678, -0.006329807, 0.012854611, -0.018447489, -0.013672414, -0.01718548, 0.022121252, -0.0062383865, -0.009868762, -0.0062786075, 0.022461548, -0.030796872, -0.0013263405, -0.007335096, -0.0108944, 0.009838738, -0.0011531354, 0.003860483, -0.0023450134, -0.009080342, 0.0050367774, 0.001801375, -0.0056223357, 0.027689928, -0.00710998, -0.0016075069, -0.010122283, 0.0014720522, -0.00087590783, -0.00468586, -0.017433718, -0.0075089065, 0.00031243693, -0.014131436, -0.0022059612, -0.007372315, -0.003341524, 0.008829484, 0.009954754, 0.0417856, -0.028474297, 0.0016868378, -0.0018722943, 0.01224108, -0.00538106, 0.003508052, 0.0012560141, -0.012004021, 0.0006881595, -0.011860973, -0.0011140413, 0.009473657, 0.02980154, -0.005046828, -0.035859976, -0.0022911755, 0.0091994405, 0.008804567, 0.019298157, 0.0071370183, 0.008790897, 0.0006298689, 0.007870869, 0.005676904, 0.0054055713, 0.0045067626, 0.0046889083, -0.0007072279, -0.024821267, 0.0023698516, -0.0013860129, -0.012410876, -0.003730225, -0.0111174425, -0.0021182578, 0.001735592, 0.008000239, 0.005071539, -0.009609594, 0.012381661, -0.010322801, 0.008711724, -0.015335517, 0.0027843658, -0.0045028552, 0.009757606, -0.008995424, -0.0074923392, -0.0026296012, -0.004626437, 0.005109528, 0.00083485595, 0.0067002256, -0.0047528455, -0.0068030753, -0.003829656, -0.00703904, -0.024862247, 0.0153830135, 0.031633284, 0.0029001161, -0.0032074975, -0.0037065153, -0.0041773934, -0.008096782, 0.0011159901, 0.0047038463, -0.0007815194, 0.013270355, -0.014053135, 0.0017289512, 0.009329935, -0.012326539, -0.0021084063, -0.0026124166, -0.009989414, 0.0011536203, -0.0062906286, -0.008888203, 0.020407123, -0.01006936, -0.0049378416, -0.0055037662, -0.004082414, -0.004523788, -0.024225611, 0.008982625, 0.012278336, -0.0070456993, -0.14935833, 0.0052466034, -0.0037812847, 0.022128776, 0.014242432, 0.016863165, 0.0025989553, -0.014397716, 0.0066571864, -0.008950038, -0.00045756207, 0.011405861, 0.006705228, 0.008438502, 0.02291194, -0.010573814, 0.005682268, 0.0029433656, 0.0032344486, -0.015140919, -0.0245021, -0.012678152, -0.01846995, 0.007666664, -0.010817025, -0.0008330189, 0.01169418, -0.008431515, -0.0075728837, 0.0018447354, -0.010145318, -0.0024452002, -0.0041292915, 0.017328998, -0.001872818, -0.035867617, -0.01595658, 0.012505418, -0.02407519, 0.028768849, 3.261683e-05, -0.0163894, -0.022508299, -0.0071928096, -0.007183226, -0.023435246, -0.024263896, 0.014717922, -0.028212355, -0.0021681031, 0.014986406, 0.0010337918, -0.011276454, -0.008575407, 0.0074252286, -0.006998238, 0.00759091, 0.0077534695, -0.027890049, 0.011553151, -0.014278793, -0.019759031, -0.015919795, 0.0010974206, 0.00012950947, -0.022728994, -0.011646136, 0.14929268, -0.0022619048, 0.007929376, 0.0035918057, -0.02577078, 0.019768674, 0.025887648, -0.034699652, -0.0011242138, -0.010586957, 0.0018745011, -0.009938943, -0.020009551, 0.007751583, -0.0055516358, 0.0062815463, -0.008866567, 0.011790403, -0.0027318452, 0.0024318884, 0.001908227, -0.010840198, -0.00071911636, -0.0029126243, 0.017376347, 0.0048133135, 0.0036800085, -0.016640583, 0.013244676, 2.3493806e-06, 0.011323674, -0.0048163095, -0.0008890517, -0.005514746, 0.001249111, -0.00017917862, 0.013287199, -0.00068993523, -0.032793146, 0.0069637373, 0.005167783, 0.0007233489, -0.010439725, -0.0076859803, -0.013506779, 0.0048158127, 0.012417878, -0.0028110126, -0.008833803, 0.0034632636, -0.008928611, -0.015408939, -0.010427744, -0.0039742165, -0.0077866986, -0.0056072283, -0.008807522, 0.005478262, -0.010334233, -0.008302581, 0.004687, 0.009193742, -0.0014488943, 0.01607971, 0.016029103, -0.016374575, 0.012336128, 0.006131906, 0.013113884, -0.12668478, 0.010297477, -0.01290761, 0.006091891, -0.018229729, 0.009523382, 0.0047045024, -0.013881937, -0.0021332619, -0.009640976, -0.002897393, -0.018041875, 0.0013313803, 0.011944808, -0.009931632, 0.0063433037, -0.011747757, 0.006046734, 0.0013418931, 0.010021503, -0.009031778, 0.022445459, 0.006276185, 0.0034737603, 0.001790302, 0.018083703, -0.023380762, -0.0003526989, -0.0029303317, 0.009562581, -0.016921088, 0.017887812, 0.011546241, -0.0040383874, -0.01374116, 0.019135322, 0.003526605, -0.011278428, 0.0068487595, -0.007882272, 0.014055997, -0.0011369474, 0.026790928, 0.009059377, -0.015144727, 0.0067106057, 0.0039799954, -0.0051267915, -0.016152438, -0.010674183, -0.02019326, 0.0169748, 0.01362697, 0.0036224385, -0.009439978, 0.0049346844, -0.021048084, 0.0033344857, 0.022131018, -0.0061067026, 0.031247983, -0.0032133735, -0.0047239778, -0.008516304, -0.0061539253, -0.01775642, 0.0006805726, -0.017091906, 0.002416999, 0.0038274226, -0.0018189102, 0.009541357, 0.0038413163, 0.022147575, 0.0027550887, -0.004162165, -0.0001379654, 0.01389346, 0.00045750744, 0.0115420045, -0.0007280935, 0.002462106, -0.019927787, -0.010358836, 0.023482978, -0.015560722, -0.019171923, 0.017762538, 0.00079405494, 0.0023529534, 0.014296198, 0.008636669, -0.0089677, -0.0014582301, -0.0040679714, 0.018727737, 0.008401454, -0.015460972, 0.001455899, -0.012758147, -0.010074231, -0.005377615, 0.0043278174, -0.00061985763, -0.016407495, -0.012740437, -0.010537353, 0.0066544213, 0.020889102, 0.003573112, -6.9540285e-05, 0.005153861, 0.01095896, -0.005774082, -0.009444549, -0.0008411763, 0.00711416, -0.012308343, -0.013546803, -0.021192271, 0.013301633, 0.006090296, 0.0065955454, 0.018208804, 0.0016732509, 0.013859509, 0.017943403, -0.029056495, -0.001883051, -0.0042902445, 0.00082638743, 0.03469812, -0.005431944, 0.005307455, 0.02115814, 0.017258318, 0.03719952, 0.005538684, 0.013563903, -0.005693029, -0.0070963944, 0.013858825, -0.02175373, 0.01359258, -0.002260952, 0.0066530383, -0.002461361, -0.010839648, -0.02795772, -0.03313797, 0.018424178, -0.0057488214, -0.023680618, 0.0026794982, -0.0012889276, 0.0114993295, -0.012776453, 0.020045096, 0.006637069, -0.007866905, -0.014132273, -0.005125176, 0.0109940125, -0.0048793973, 0.014195959, -0.008437784, -0.0031599181, -0.013442701, -0.008278739, -0.026036678, -0.0032599757, 0.006108852, 0.00082322553, -0.032888617, 0.009069957, -0.0023959784, -0.008172486, -0.010934763, -0.008896576, -0.07162787, 0.0064521236, 0.0063588913, -0.015548977, -0.008557886, -0.0098282825, 0.0041913157, -0.0007282342, -0.01620867, -0.008374064, -0.019548811, -0.0086380495, -0.014811584, -0.032599043, 0.00031680524, -0.0053156507, 0.002181941, 0.026087586, -0.009352343, -0.015682684, -0.00038441468, 0.011328768, -0.009541176, -0.0032452163, 0.008117777, -0.023082927, 6.061189e-05, 0.009304622, -0.0060454737, 0.0037914466, -0.004953018, 0.001961619, -0.013517446, -0.008584327, -0.008046001, -0.00064586516, 0.008777628, -0.010712966, 0.0007729347, -0.0830852, -2.428962e-06, 0.017316287, -0.108756416, -0.007730003, 0.0025661886, 0.016229197, 0.004209969, -0.0038254347, -0.012786543, -0.012528152, 0.015372055, -0.0014539312, -0.039067674, -0.02267808, 0.0056926957, -0.0010708453, 0.0013234267, 0.020668007, -0.003893883, 0.010392502, 0.006844529, -0.02333346, -0.004555892, 0.006166311, 0.0036673143, 0.01680249, -0.0061419886, 0.013211252, -0.011193497, 0.00675008, -0.0041547627, -0.02597754, 0.0033610146, -0.009838674, -0.03307638, -0.020825613, -0.0028041706, 0.019231398, 0.004461742, 0.008398258, 0.0050105844, -0.010228024, 0.0044683656, 0.04275091, 0.0046437723, 0.012000208, -0.003836017, -0.10746471, -0.0018085433, 0.007703087, -0.004399734, -0.003940902, 0.023330458, -0.0046167783, 0.08219082, -0.016735516, -0.020991348, -0.018470936, 0.005753882, 0.0026707968, -0.00068131345, -0.011876057, 0.0072590257, 0.031001976, -0.00856986, 0.012039944, 0.020340186, 0.0048355996, -0.0047671236, -0.016179841, -0.009225065, 0.006123793, -0.07549429, -0.006284297, 0.024376297, -0.009232946, -0.003777871, -0.033297546, 0.007049522, 0.017356643, 0.0023655368, 0.003907212, 0.0131419245, -0.022967765, -0.001489369, -0.0054865214, 0.009529271, 0.005789033, -0.019526435, -0.009602835, -0.0070058666, -0.0067583183, -0.0047571836, -0.0018527306, -0.015070067, -0.00756127, -0.009757633, 0.013453507, -0.007147263, -0.010773475, -0.0132874185, 0.001953532, -0.002092698, -0.02656835, -0.025442246, 0.011287714, -0.020615524, -0.008671079, -0.009830167, -0.013420786, -0.0101651605, -0.0040624025, -0.007832689, -0.00932102, 0.0014868347, -0.008759791, 0.00444122, -0.007419411, 0.012611942, 0.012342522, -0.013245931, 0.003177388, 0.0032090533, 0.0050824126, 0.01253902, -0.041413724, 0.009983636, -0.008433785, -0.01122001, -0.020754334, -0.012915869, -0.00090874033, 0.008958098, 0.0064951302, 0.020868523, 0.01668852, -0.007790789, 0.010808147, 0.018377783, 0.00034998622, 0.029473936, 0.010389186, -0.009687151, -0.014813856, -0.0096462425, 0.0049597328, 0.010363435, 0.0067558014, 0.0045931856, 0.003226521, -0.015061491, 0.01492404, -0.00049347605, 0.008951774, -0.010018832, 0.009810007, 0.009231421, 0.0038150246, 0.0017688086, 0.004076255, -0.011421568, -0.008272109, 0.009172069, 0.009421301, -0.011439863, 0.00524844, 0.012646373, 0.0020763138, -0.005658173, 0.013082962, 0.013584786, 0.00557326, -0.0067631775, -0.0091373455, -0.007857587, -0.0046190126, -0.007914818, 0.0010943434, -0.0016080764, 0.00930219, 0.018042503, -0.00306818, -0.026120514, -0.014606018, 0.0018397389, -0.031813968, -0.0074815215, -0.0033373558, -0.00036908055, 0.015105216, -0.0069491416, -0.009665044, 0.0021387856, 0.0032617415, -0.034064095, -0.014215866, -0.00775064, -0.014567967, 0.0029626612, 0.015991721, 0.004156043, 0.0078727715, 0.006587294, 0.02210505, -0.012579499, 0.005996727, 0.009507821, 0.010743617, -0.017235408, 6.212451e-05, 0.0046912776, -0.004063672, 0.0009771558, -0.0066717966, -0.009761068, 0.00932408, -0.014801524, 0.010376551, -0.015729886, 0.00046441559, -0.00083358353, 0.027024275, 0.0010035275, -0.019530585, 0.00886839, 0.012207581, -0.0056337155, 0.01633391, 0.0069756173, -0.0069564935, -0.0018204364, -0.00090206903, -0.0012941383, 0.0020163816, -0.0002808127, -0.00753573, 0.013887638, 0.013042275, 0.007507433, 0.0019925814, -0.00781426, 0.010144279, -0.004351086, 0.0021237906, 0.010244952, 0.013809877, -0.003964897, 0.017139615, -7.792459e-05, -0.012532174, 0.012881295, -0.012616406, -0.0043434566, -0.004724864, 0.0033116261, 0.013540465, 0.009488316, 0.00080803473, 0.016819865, -0.009195633, -0.010831172, 0.0023206496, -0.010357162, 0.0196528, 0.018077776, 0.012280451, 0.021282826, -0.0017991216, 0.038695145, 0.015119633, 0.018358342, -0.027791465, -0.00795313, -0.0075349263, -0.016985605, 0.022391059, -0.021271383, 0.0010191659, -0.0043036304, 0.0233677, 0.0019020434, -0.00011517184, -0.00080355164, -0.003172825, -0.009979431, -0.008670905, 0.021396408, -0.009114325, 0.007987674, 0.0022452588, 0.015091672, -0.0023400553, -0.0116705755, -0.025928995, 0.014652601, 0.0009633738, -0.020032348, 0.026769402, 0.011789469, 0.008797259, -0.008477736, 0.019881811, 0.003545251, -0.016234523, -0.014304422, -0.00809079, 0.022835607, -0.01785549, -0.016647207, 0.00904696, -0.0015729992, -0.01975196, -0.023441102, 0.0003723674, 0.0058947713, -0.007255995, -0.0057688956, -0.009820494, -0.0060878224, 0.008484596, -0.011534788, 0.0015637942, -0.01419248, 0.0017263929, -0.0052443524, 0.019802405, 0.001225671, 0.014340769, -0.013448191, -0.00018325198, -0.027506964, -7.173194e-05, 0.021697888, -0.016162252, 0.01700061, 0.029689452, -0.014555747, 0.0012082515, 0.010562425, 0.006226294, -0.0030662515, -0.006938271, -0.0028471157, -0.02559404, 0.028940633, -0.010270217, 0.018497888, 0.02601707, -0.0006079461, 0.019324476, 0.0027579037, 0.008562281, -0.005670541, 0.009176606, -0.029601146, -0.021393497, 0.021273034, -0.019668499, 0.005052752, -0.0105899535, -0.015834808, -0.023484152, 0.020581562, -0.0068201874, 0.00074847066, -0.008686508, -0.016791703, -0.0051481584, 0.009550718, 0.0062606456, -0.0032849621, -0.0041963956, -0.0028667375, 0.0028904628, -0.00568322, -0.02077322, 0.0036082247, 0.019719467, -0.010297858, 0.016155446, 0.017717332, -0.004021236, 0.008465307, -0.007111753, 0.004578509, 0.008936054, -0.025295148, 0.013858663, -0.001237728, 0.014457752, -0.012742605, -0.017283771, 0.0009648054, -0.010608118, -0.0028960183, 0.017612234, -0.03109325, -0.021630682, -0.013064359, 0.012724856, -0.010187125, 0.012601525, 0.0033426515, -0.006254907, -0.030062592, -0.0014536467, -0.01614592, -0.00034533849, 0.025173001, 0.0052557387, 0.005314731, -0.016734494, -0.002542325, 0.01785605, -0.011668822, -0.006119833, -0.014508945, 0.007371308, 0.03941403, 0.015699105, 0.018253343, 0.0040751286, 0.0028423285, 0.0024320174, -0.011141092, -0.0035701953, -0.011208033, -0.0077683995, -0.027283045, 0.02088113, 0.00090462517, -0.010176105, -0.006701472, 0.013496733, 0.014288801, -0.009993828, -0.00018817882, -0.00414491, -0.0029090298, 0.011860872, -0.0113942195, -0.015853364, -0.021001516, -0.00367157, -0.011814665, -0.011323115, 0.017205564, -0.00869297, -0.011849278, -0.019990943, -0.014254386, -0.014171208, 0.0087209325, 0.020860223, -0.0063623427, -0.0017618868, 0.0044284533, 0.0149742095, -0.00027864036, -0.0029971995, 0.03544539, -0.034340914, 0.032153472, -0.007570131, 0.008970622, 0.0047131376, -0.024013996, 0.011684, -0.021221105, 0.008602621, 0.00019398263, -0.0117123695, 0.011170078, 0.024843687, 0.01650534, 0.02606747, -0.0064837914, 0.013417515, 0.002747155, -0.006562077, -0.01204688, -0.018846756, -0.0057117497, 0.0012827666, 0.0184328, -0.00012921104, 0.017023366, -0.0069575817, -0.0002056795, 0.0029186383, 0.0077567548, -0.0067541776, -0.0007348651, -0.004799254, 0.0044399407, 0.0003797854, 0.010580307, 0.009873728, -0.019635191, -0.017342087, -0.020212067, 0.0028384805, -0.0080208, 0.009567811, -0.0007796576, 0.031240895, -0.0018750791, 0.019245384, -0.020248964, 0.018052509, 0.011970479, -0.012003571, -0.0011291454, 0.018232146, 0.0036269147, 0.0075759324, 0.011252869, -0.047766786, 0.0012596642, -0.02631644, -0.004070148, 0.010821286, 0.011447725, -0.001117424, -0.004744531, 0.006991576, -0.042313233, -0.008592272, 0.026370335, -2.3971006e-05, 0.010191152, -0.00793958, 0.016548706, -0.00026849893, -0.022383675, 0.0018548708, -0.0098592425, -0.0030918743, -0.004157958, 0.005023935, -0.00061654835, 0.0067712287, -0.01961316, 0.0037674857, -0.017119687, 0.0009874273, -0.0066784737, 0.010799525, 0.008092136, -0.0012137911, 0.0032556497, 0.0021385641, -0.00984951, 0.02049103, 0.00044910656, 0.006272808, -0.00783443, -0.01738256, 0.019875936, 0.009232503, 0.008307522, 0.00026251763, -0.012403779, -0.019966982, 0.0052092695, -0.0041619227, -0.006804656, -0.01582546, -0.00031881282, -0.013587425, 0.018506572, 0.00089664425, 0.0027310327, -0.0098019885, 0.020930747, 0.00696755, -0.013611554, -0.019281045, 0.0072714463, 0.006559659, -0.00085153716, 0.01180271, -0.010139206, -0.016781311, 0.0034982169, 0.0036344256, -0.01874168, -0.008483717, 0.02792166, -0.0045591914, -0.011977336, 0.014841909, -0.015000914, -0.0011585405, 0.014136167, -0.008248924, 0.006765316, 0.008344074, 0.012844654, 0.011012111, -0.008817875, -0.0010248242, -0.007510564, -0.009141047, 0.0011939633, 0.028684033, -0.007708751, -0.004582788, 0.005350681, -0.0003307823, -0.0029305548, -0.02370028, -0.0015965529, -0.0062581375, 0.008461159, -0.01662694, 0.0050907508, 0.000953224, -0.0047098724, -0.012384018, -0.0065146554, 0.015285855, 0.008044381, 0.0072363666, -0.009808979, 0.020058757, 0.004084943, -0.009463193, -0.027907455, -0.006593386, -0.004077442, 0.00029650825, -0.0122551145, -0.017011806, -0.0014346242, 0.008507112, 0.0170903, -0.006564867, 0.0024811525, 0.01226301, -0.011548405, 0.005825921, -0.019724127, 0.014004789, 0.0015140524, 0.012106749, -0.025206944, -0.007600714, -0.023344714, 0.008932906, 0.008057862, 0.004850376, -0.025567614, 0.0029184604, -0.022189442, -0.009166644, -0.00702203, -0.0033918887, 0.05402591, 0.005644595, 0.010009892, -0.006302303, -0.0005718571, -0.0045136805, -0.01391086, 0.016332597, -0.016566997, 0.010651967, 0.010839459, 0.008895828, -0.00036628987, 0.011179405, -0.020096641, 0.0125887375, 0.01454104, -0.020181691, 0.010222591, -0.0064351284, 0.010424887, -0.0010851625, 0.005533678, 0.0056387545, -0.0028192652, 0.007506625, -0.0065348744, -0.005137967, -0.0043498413, 0.02990783, -0.00433879, -0.0016323418, 0.023944823, 0.02748858, 0.0049757734, 0.020043433, -0.0014850324, 0.00044463284, -0.00918921, -0.020677669, -0.005252534, -0.014761545, -0.005665723, 0.0014824417, 0.00068657217, -0.001191136, 0.002552996, -0.0075908373, 0.0127985645, 0.018351544, -0.015742399, 0.005090905, -0.0059985234, 0.025805037, -0.017339507, -0.0011999041, -0.0045762756, -0.013238929, -0.018672979, -0.0116972765, -0.006331599, 0.02033366, 0.011919027, -0.0041197413, 0.015034593, 0.008451824, -0.008876071, 0.0030703684, 0.028703732, 0.024448216, 0.02864402, 0.0031689426, 0.004659375, 0.006847174, 0.0043375934, 0.18593927, 0.11358892, 0.0077961856, -0.00034353754, 0.018939253, 0.024307873, -0.0110852625, -0.0016438784, -0.0026051276, -0.022744335, 0.0067470707, 0.016591175, 0.01475056, -0.016855545, 0.012999009, 0.0011903716, -0.0039583487, 0.025193634, -0.010238333, 0.016115732, 9.228239e-05, 0.0010879317, 0.0097803, 0.016252926, -0.029275576, -0.0010264198, 0.0030883143, 0.014760506, -0.0025324535, -0.020443894, -0.011386674, 0.0026467913, 0.0056586443, -0.023462662, -0.010537932, 0.005694307, -0.01749639, 0.02237881, -0.0015299142, -0.009622504, -0.010491658, -0.019467067, -0.0054477733, -0.01724457, 0.02038574, 5.0789065e-05, 0.009272328, 0.012588042, -0.0113316765, 0.018471323, -0.026275478, 0.005906785, 0.00023453555, 0.011081587, -0.015735196, 0.0084206695, 0.010646734, 0.027571198, -0.024603859, 0.021795388, 0.006626273, -0.013858568, -0.009185088, 0.0048373775, 0.016077789, -0.022512428, -0.014068438, -0.0060155084, -0.010931034, 0.016733091, -0.010552336, 0.03850463, 0.019421646, 0.017332405, -0.008889988, 0.0007118854, 0.0065911, -0.0016337573, -0.0070234514, 0.014631724, 0.011132708, -0.004553864, 0.0048363972, 0.019064343, 0.005270032, -0.010202394, -0.0027539516, 0.043107178, 0.14183801, 0.012001395, 0.0022062785, -0.04187179, -0.0017946546, -0.01529787, -0.021273978, 0.03952792, 0.0049006585, -0.007014275, 0.031223092, -0.0034481245, -0.0080943005, 0.0056209434, -0.0006067711, 0.0005364425, 0.030859195, 0.03294064, 0.00679304, 0.0065143066, -0.012408009, 0.0014562003, 0.008726774, -0.009266681, -0.009994519, -0.0024985168, 0.0017805471, -0.0048832507, -0.02593215, -0.007984349, -0.07247088, 0.0029002384, 0.017654346, 0.0058383066, 0.043372877, -0.009211388, 0.032625005, -0.0100344755, 0.022606786, -0.0037949972, -0.0060907723, 0.0054580127, -0.005647807, 0.0057016616, -0.018335352, -0.005624589, 0.00803492, 0.013766095, 0.00627174, 0.008879953, 0.014261424, -0.013445008, -0.023862408, -0.0006942117, -0.0028912872, 0.018839544, -0.005971675, -0.019398425, 0.022604324, -0.0057781823, 0.005160266, 0.021051526, 0.0078025227, -0.0029201221, -0.014019406, -0.002162462, -0.007314065, 0.021968747, 0.015388177, -0.010980635, 0.013912614, -0.04489807, 0.013907108, -0.031323347, -0.005340135, 0.009385926, 0.020403782, -0.007922407, -0.0028811255, -0.012078041, 0.06732479, -0.015099968, -0.01510081, -0.0034725096, 0.00069292326, -0.0105773, -9.615218e-05, 0.011361641, -0.009324162, 0.018803656, 0.0060403524, 0.031471737, -0.002871831, -0.009261547, -0.024080332, -0.029867763, -0.0028444899, 0.0126290005, 0.0064525655, 0.009535384, 0.0018380082, 0.010934385, 0.00535749, -0.008399782, 0.007888487, 0.013109941, -0.009229801, 0.0070626657, -0.023011368, -0.0037599797, 0.0021821873, -0.0088634845, 0.003102837, 0.120267846, 0.029949596, -0.00082687085, 0.032268263, 0.019633695, -0.018987287, -0.012840059, 0.0047522765, -0.0153615875, 0.015115113, -0.01778481, -0.011955586, 0.011882322, 0.002840367, -0.0057521807, -0.02132081, 0.010234887, -0.0047166073, -0.016554015, 0.013520649, -0.0040855533, 0.005977744, 0.004785389, 0.00082922814, -0.009773279, -0.010626038, -0.018660791, 0.0049575875, -0.0129531445, -0.005834719, 0.00594567, -0.006974976, 0.0075202244, -0.007455956, -0.017357731, -0.0012175849, 0.0064733583, 0.00017129762, -0.011016252, -0.020319717, 0.003705458, 0.011627933, 0.0024432258, 0.0004630454, -0.026130725, 0.19603501, 0.0050560515, -0.0096923355, 0.011975778, 0.0053425953, -0.009289195, 0.0020369752, -0.014424216, 0.00024016795, 0.013133909, 0.023778945, 0.0018605777, -0.007964138, -0.0014225661, 0.006358891, -0.012099161, -0.019567491, 0.012959731, 0.0007453863, 0.022608886, 0.016017815, 0.0089986, -6.6720626e-05, -0.022200238, -0.02055415, -0.00028567394, -0.020881955, 0.020459192, 0.00013000354, 0.01262613, -0.012335466, -0.015772164, 0.003373356, 0.01404346, 0.0019944778, 0.006895846, -0.0043624593, 0.004957117, -0.013275227, 0.012359272, -0.0037367402, -0.0056085344, -0.018097468, 0.031339362, 0.017205607, -0.002862736, 0.0010727163, -0.0018853907, 0.0077808825, 0.0034113745, 0.011531603, -0.009313413, -0.017247496, -0.013746809, -0.0045747873, -0.002845247, 0.0031907044, 0.031069957, -0.007121419, 0.009957184, 0.008084, -0.0056706397, 0.024182845, -0.0047471025, -0.0072742268, -0.0017504832, 0.005262776]\n",
            "Found 5 potential recommendations:\n",
            "\n",
            "--- Recommendations ---\n",
            "  - Score: 0.7288\n",
            "    Title: Girlfriends\n",
            "    Genre: Comedy\n",
            "    Year: 2021.0\n",
            "----------\n",
            "  - Score: 0.7194\n",
            "    Title: Mes meilleures copines\n",
            "    Genre: Comedy\n",
            "    Year: 2003.0\n",
            "----------\n",
            "  - Score: 0.7134\n",
            "    Title: Funny Birds\n",
            "    Genre: Comedy, Drama\n",
            "    Year: 2024.0\n",
            "----------\n",
            "  - Score: 0.7103\n",
            "    Title: Mulheres Alteradas\n",
            "    Genre: Comedy\n",
            "    Year: 2018.0\n",
            "----------\n",
            "  - Score: 0.7087\n",
            "    Title: Change of Plans\n",
            "    Genre: Comedy, Romance\n",
            "    Year: 2009.0\n",
            "----------\n"
          ]
        },
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "/tmp/ipykernel_26130/3969524323.py:26: DeprecationWarning: `search` method is deprecated and will be removed in the future. Use `query_points` instead.\n",
            "  search_result = qdrant_client.search(\n"
          ]
        }
      ],
      "source": [
        "query = \"\"\"\n",
        "  I want to watch something with my girlfriends that’s\n",
        "  both funny and teaches something.\n",
        "\"\"\"\n",
        "recommendations = recommend_movies(query, top_k=5)\n",
        "\n",
        "if recommendations:\n",
        "    print(\"\\n--- Recommendations ---\")\n",
        "    for rec in recommendations:\n",
        "        print(f\"  - Score: {rec['score']:.4f}\")\n",
        "        print(f\"    Title: {rec['payload'].get('title', 'N/A')}\")\n",
        "        print(f\"    Genre: {rec['payload'].get('genres', 'N/A')}\")\n",
        "        print(f\"    Year: {rec['payload'].get('release_year', 'N/A')}\")\n",
        "        print(\"-\" * 10)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "CRqEnlN8AK6w"
      },
      "source": [
        "## Next Steps\n",
        "\n",
        "This notebook demonstrated how to build a movie recommendation system by combining the Gemini API’s embedding capabilities with Qdrant’s vector search.\n",
        "\n",
        "### Useful API References\n",
        "\n",
        "For more detailed understanding and to explore advanced features, refer to the official documentation:\n",
        "\n",
        "* **[Gemini API Embeddings Documentation](https://ai.google.dev/gemini-api/docs/embeddings)**: Learn how to generate text embeddings, understand model parameters, and use them effectively for semantic search and similarity tasks.\n",
        "\n",
        "* **[Qdrant Python Client Docs](https://python-client.qdrant.tech/)**: Understand how to manage collections, insert and search vectors, configure indexing, and interact with the vector database.\n",
        "\n",
        "### Related Examples\n",
        "\n",
        "To explore more use cases and get additional inspiration, check out these related notebooks in this directory:\n",
        "\n",
        "* **[Similarity Search using Qdrant](../examples/qdrant/Qdrant_similarity_search.ipynb)**: A focused example on building semantic search systems with embeddings and Qdrant.\n",
        "\n",
        "* **[Google GenAI SDK Overview](../../quickstarts/Get_started.ipynb)**: Walks you through installing and setting up the SDK, text and multimodal prompting, token counting, safety filters, multi-turn chat, function calling, file uploads, context caching, and more.\n",
        "\n",
        "* **[Text Embeddings with Gemini API](../../quickstarts/Embeddings.ipynb)**: Focuses on generating and working with text embeddings using the Gemini API, ideal for building vector-based search and recommendation systems.\n"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "name": "Movie_Recommendation.ipynb",
      "toc_visible": true
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
